<template>
  <div class="charts">
    <van-nav-bar
      placeholder
      title="讲师中心"
      fixed
      left-arrow
      @click-left="back"
    >
    </van-nav-bar>
    <div class="charts__content">
      <div class="charts__sort sort">
        <div class="sort__content">
          <BaseSortScore @click="clickItem" :list="list"></BaseSortScore>
          <!-- <div class="sort__item">
            <img class="hg" src="@/assets/images/one.png" />
            <div class="sort__inner">
              <img class="avatar" src="@/assets/images/tx.png" />
              <span class="no">No.1</span>
              <span class="name">力宏</span>
              <div>学分:122</div>
            </div>
          </div>
          <div class="sort__item">
            <img class="hg" src="@/assets/images/two.png" />
            <div class="sort__inner" style="border-color: #ffb00d">
              <img
                class="avatar"
                style="border-color: #ffb00d"
                src="@/assets/images/tx.png"
              />
              <span
                class="no"
                style="background-color: #ffc140; border-color: #ffb00d"
                >No.2</span
              >
              <span class="name">力宏</span>
              <div style="background-color: #ffc140">学分:122</div>
            </div>
          </div>
          <div class="sort__item">
            <img class="hg" src="@/assets/images/three.png" />
            <div class="sort__inner" style="border-color: #0dc678">
              <img
                class="avatar"
                style="border-color: #0dc678"
                src="@/assets/images/tx.png"
              />
              <span
                class="no"
                style="background-color: #0dc678; border-color: #00ae65"
                >No.3</span
              >
              <span class="name">力宏</span>
              <div style="background-color: #0dc678">学分:122</div>
            </div>
          </div> -->
        </div>
      </div>

      <div class="charts__more">
        <div class="charts__my">
          <div class="charts__my-left">
            <div class="charts__my-title">
              <div>我的</div>
              <div>排名</div>
            </div>
            <img src="@/assets/images/login.png" />
            <span>晨夕会</span>
          </div>
          <div class="charts__my-sort">第10名</div>
          <div class="charts__my-score">96分</div>
        </div>

        <div class="charts__ph">
          <div class="thead">
            <div class="th1 color-q">排行</div>
            <div class="th2 color-q" style="transform: translateX(10px)">
              姓名
            </div>
            <div class="th4 color-q">课程数</div>
            <div class="th3 color-q">耗时</div>
          </div>
          <div class="tbody">
            <div class="trow" v-for="i in 10" :key="i" @click="clickItem">
              <div class="th1">{{ i }}</div>
              <div class="th2">
                <img src="@/assets/images/login.png" />
                <span>晨夕会</span>
              </div>
              <div class="th4">5</div>
              <div class="th3">98分</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script name="Lecturer" setup>
import { ref } from "vue";
import { useRouter } from "vue-router";
const router = useRouter();
const getImg = (name) => {
  return `/src/assets/images/${name}.png`;
};

const list = [
  {
    rankImg: getImg("one"), //ref('@/assets/images/one.png'),
    imgUrl: getImg("tx"), //ref("@/assets/images/tx.png"),
    rank: "1",
    name: "王力宏",
    score: "120",
    scoreName: "学分",
  },
  {
    rankImg: getImg("two"), //ref('@/assets/images/one.png'),
    imgUrl: getImg("tx"), //ref("@/assets/images/tx.png"),
    rank: "2",
    name: "刘德华",
    score: "120",
    scoreName: "学分",
  },
  {
    rankImg: getImg("three"), //ref('@/assets/images/one.png'),
    imgUrl: getImg("tx"), //ref("@/assets/images/tx.png"),
    rank: "3",
    name: "谢霆锋",
    score: "120",
    scoreName: "学分",
  },
];
const active = ref(1);
const back = () => {
  window.history.back();
};
//学霸榜
const clickItem = (value) => {
  router.push({
    path: "/lecturer-center",
  });
};
</script>
<style lang="scss" scoped>
.charts {
  min-height: 100vh;
  background-image: url("@/assets/images/jbbj.png");
  background-size: 100% auto;
  background-repeat: no-repeat;
  background-color: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
  ::v-deep .van-nav-bar {
    background: transparent;
  }
  &__tabs {
    display: flex;
    align-items: center;
    .tab {
      width: 100px;
      height: 30px;
      background: rgba(227, 227, 227, 0.4);
      border-radius: 15px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid #ffffff;
      margin: 0 6px;
      font-size: 14px;
      font-family: PingFangSC, PingFang SC;
      font-weight: 400;
      color: #676b6b;
      &.is--active {
        color: #ffffff;
        border-color: #00c37d;
        background: #00c37d;
      }
    }
  }
  &__zz {
    display: flex;
    align-items: center;
    justify-content: center;
    span {
      font-size: 14px;
      font-family: PingFangSC, PingFang SC;
      font-weight: 400;
      color: #171a1d;
      line-height: 20px;
    }
    img {
      width: 24px;
      height: 24px;
    }
  }
  &__content {
    padding: 20px 16px;
  }

  &__more {
    background: #ffffff;
    border-radius: 12px;
    padding: 12px 16px;
  }
  &__my {
    padding: 10px 12px;
    background: #ffffff;
    box-shadow: 0px 0px 8px 0px rgba(219, 219, 219, 0.32);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    &-left {
      display: flex;
      align-items: center;
      img {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        margin: 0 10px;
      }
      span {
        font-size: 14px;
        font-family: PingFangSC, PingFang SC;
        font-weight: 500;
        color: #272b2d;
      }
    }
    &-title {
      font-size: 16px;
      font-family: PingFang-SC, PingFang-SC;
      font-weight: 800;
      color: #0dc678;
      line-height: 22px;
    }
    &-sort {
      font-size: 16px;
      font-family: PingFangSC, PingFang SC;
      font-weight: 500;
      color: #0dc678;
      line-height: 22px;
    }
    &-score {
      font-size: 16px;
      font-family: PingFangSC, PingFang SC;
      font-weight: 500;
      color: #0dc678;
      line-height: 22px;
    }
  }

  &__ph {
    padding-top: 14px;
    .thead {
      display: flex;
      align-items: center;
      height: 20px;
      margin-bottom: 14px;
      .color-q {
        font-size: 14px;
        font-family: PingFangSC, PingFang SC;
        font-weight: 400;
        color: #b9bdbd;
        line-height: 20px;
      }
    }
    .trow {
      display: flex;
      align-items: center;
      margin-bottom: 20px;
    }
    .th1 {
      width: 28px;
      text-align: center;
    }
    .th2 {
      display: flex;
      align-items: center;
      flex: 1;
      padding-left: 26px;
      img {
        width: 40px;
        height: 40px;
        margin-right: 10px;
        border-radius: 50%;
      }
      span {
        font-size: 14px;
        font-family: PingFangSC, PingFang SC;
        font-weight: 500;
        color: #272b2d;
      }
    }
    .th3 {
      font-size: 16px;
      font-family: PingFangSC, PingFang SC;
      font-weight: 500;
      color: #272b2d;
    }
    .th4 {
      width: 42px;
      margin-right: 48px;
      text-align: center;
    }
  }
}
.sort {
  &__content {
    //display: flex;
    justify-content: space-between;
    // background-color: #fff;
    border-radius: 4px;
    padding: 8px 0 16px 0;
  }
  &__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    .hg {
      width: 25px;
      height: 20px;
    }
    .avatar {
      position: absolute;
      top: -20px;
      width: 48px;
      height: 48px;
      border-radius: 50%;
      border: 1px solid #ff3b3b;
    }
  }
  &__inner {
    padding-top: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border-radius: 10px;
    width: 106px;
    height: 134px;
    transform: translateY(24px);
    position: relative;
    border: 1px solid #ff2d2d;
    .no {
      width: 53px;
      height: 20px;
      background: #ed7243;
      border: 1px solid #ed4343;
      border-radius: 4px;
      display: flex;
      justify-content: center;
      align-items: center;
      font-family: PingFangSC-Semibold;
      font-size: 14px;
      color: #ffffff;
      margin: 4px 0;
    }
    .name {
      font-family: PingFangSC-Medium;
      font-size: 14px;
      color: #272b2d;
    }
    div {
      margin-top: 12px;
      text-align: center;
      line-height: 26px;
      background: #ed7243;
      border-radius: 13px;
      width: 78px;
      height: 26px;
      font-family: PingFangSC-Medium;
      font-size: 14px;
      color: #ffffff;
    }
  }
}
</style>
